package com.rmb.finance.controller;

import com.github.pagehelper.PageInfo;
import com.rmb.mart.entity.linxi.RmbFinanceAccount;
import com.rmb.finance.service.RmbFinanceAccountService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (RmbFinanceAccount)表控制层
 *
 * @author makejava
 * @since 2021-01-22 22:39:00
 */
@RestController
@RequestMapping("rmbFinanceAccount")
public class RmbFinanceAccountController {
    /**
     * 服务对象
     */
    @Resource
    private RmbFinanceAccountService rmbFinanceAccountService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public RmbFinanceAccount selectOne(Long id) {
        return this.rmbFinanceAccountService.queryById(id);
    }

    /**
     * 查询账户信息
     * @param page 起始页数
     * @param size 条数
     * @return 列表
     */
    @GetMapping("findList/{page}/{size}")
    public PageInfo<RmbFinanceAccount> findList(@PathVariable("page")int page,@PathVariable("size")int size){
        return rmbFinanceAccountService.findList(page,size);
    }

    /**
     * 修改账户
     * @param rmbFinanceAccount 账户数据
     * @return 是否
     */
    @PutMapping("updateAccount")
    public int updateAccount(@RequestBody RmbFinanceAccount rmbFinanceAccount){
        return rmbFinanceAccountService.updateAccount(rmbFinanceAccount);
    }
}